import { Store } from 'vuex'
import { getModule } from 'vuex-module-decorators'
import AuthModule from '~/store/auth'
import AppModule from '~/store/app'
import OauthModule from '~/store/oauth'

// eslint-disable-next-line import/no-mutable-exports
let authStore: AuthModule
// eslint-disable-next-line import/no-mutable-exports
let appStore: AppModule
// eslint-disable-next-line import/no-mutable-exports
let oauthStore: OauthModule

function initialiseStores (store: Store<any>): void {
  authStore = getModule(AuthModule, store)
  appStore = getModule(AppModule, store)
  oauthStore = getModule(OauthModule, store)
}

export {
  initialiseStores,
  authStore,
  appStore,
  oauthStore
}
